# Copyright:: Copyright (c) 2008 Howling Moon Software

class TextDemo

	def initialize
		super
		
		listNode = AS::Scene::DisplayListNode.from_render_block(GL::LINE_LOOP) do
			GL.Vertex(100, 100)
			GL.Vertex(200, 100)
			GL.Vertex(200, 200)
			GL.Vertex(100, 200)
		end
		
		var = VertexArray.new(2, 3, 0)
		var.color(1,0,0).vertex(300, 300)
		var.color(0,1,0).vertex(400, 300)
		var.color(0,0,1).vertex(400, 400)
		var.color(1,1,1).vertex(300, 400)
		
		vnode = AS::Scene::VARNode.new(var.pack, 2, 3, 0)
		
		@view_root = AS::Scene::GroupNode.new [
			listNode,
			vnode,
		]
	end
	
	def draw
		AS.clear_screen
		@view_root.render
		#AS.print_gl_errors - We took this out of aerosol, as part of some refactoring.
	end
end
